package resource.manager;

import java.util.Timer;
import java.util.TimerTask;

import resource.manager.classes.RuntimeManager;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;

public class RuntimeDatabaseService extends Service {

	private Timer timer = new Timer();
	
	@Override
	public IBinder onBind(Intent arg0) {
		return null;
	}
	
	public void onCreate() {
		super.onCreate();
		startservice();
	}

	private void startservice() {
		
		timer.scheduleAtFixedRate( new TimerTask() {
		public void run() {
			//Log.i("iiiii", "iiiiiie");
			RuntimeManager rm;
	        try{
	        	rm = new RuntimeManager();
	            String output = rm.execCommand("");
	            Log.i("log runtime", output);
	        } catch (Exception ex){
	        }
		}
		}, 0, 100000);

		;  
		}

	/*
		private void stopservice() {
		if (timer != null){
		timer.cancel();
		}
		}

	 */

}
